Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zoom to data #3

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Zoom to data #3

wants to merge 1 commit into from

Conversation

arcresu
Copy link
Contributor

@arcresu arcresu commented May 26, 2023

Previously there was a coord_automap_zoom() that used a hacky workaround to give a sensible default zoom. The idea is that the normal ggplot2::coord_sf() keeps track of the bounding box but doesn't discriminate between layers, so adding the base map with geom_boundaries() ends up making the bounding box too big. In some cases that's what was intended, but in other cases it can be nice to zoom into the area bounding the actual data (excluding the base map).

This was originally done with a hack that doesn't adhere to the ggplot layer structure. Ideally it would something like coord_automap(zoom = "data") rather than a separate function. The coord will probably need to gain a concept of "base maps" and track two different bounding boxes.

@arcresu arcresu added the enhancement New feature or request label May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant